<template>
  <div>
    <a-card :bordered="false">
      <div class="system-notice">
        <a-tabs v-model="activeTab">
          <a-tab-pane key="sysNotify" :tab="$t('all.autotext841')" v-if="$auth('SYSTEM_NOTICE.NOTICE_LIST')">
            <SystemNotify></SystemNotify>
          </a-tab-pane>
          <a-tab-pane key="form" :tab="$t('all.autotext1493')" v-if="$auth('SYSTEM_NOTICE.USER_FEEDBACK_LIST')">
            <FeedbackListBackend ref="form"></FeedbackListBackend>
          </a-tab-pane>
        </a-tabs>
      </div>
    </a-card>
  </div>
</template>

<script>
import FeedbackListBackend from '@views/system-notice/components/feedback-list-backend.vue'
import SystemNotify from './system-notify.vue'
export default {
  name: 'system-notice',
  components: {
    FeedbackListBackend,
    SystemNotify
  },
  data () {
    return {
      activeTab: ''
    }
  },
  created () {
    this.initActiveTab()
  },
  methods: {
    initActiveTab () {
      if (this.$auth('SYSTEM_NOTICE.NOTICE_LIST')) {
        this.activeTab = 'sysNotify'
      } else if (this.$auth('SYSTEM_NOTICE.USER_FEEDBACK_LIST')) {
        this.activeTab = 'form'
      }
    }
  }
}
</script>

<style scoped>

</style>
